import { isObject } from "./utils"

export function transformRequest(data: any): any {
  if(isObject(data)) {
    return JSON.stringify(data)
  }
}

export function transformResponse(data: any): any {
  if(typeof data === 'string') {
    try {
      return JSON.parse(data)
    } catch (e) {
      // do nothing
    }
  }
}